package com.nju.edu.erp.service.hr.test;

import com.nju.edu.erp.dao.SaleSheetDao;
import com.nju.edu.erp.dao.StuffDao;
import com.nju.edu.erp.service.hr.GetSalary;
import com.nju.edu.erp.service.hr.GetSalaryImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

@Service
public class GetSalaryDriver {
    private final GetSalary getSalary;
    private final StuffDao stuffDao;
    private final SaleSheetDao saleSheetDao;
    @Autowired
    GetSalaryDriver(StuffDao stuffDao,SaleSheetDao saleSheetDao){
        this.saleSheetDao=saleSheetDao;
        this.stuffDao=stuffDao;
        this.getSalary=new GetSalaryImpl(stuffDao,saleSheetDao);
    }

    public BigDecimal getASalary(String name){
        return getSalary.getSalaryByName(name);
    }

}
